<template>
	<wd-navbar
		:title="props.title"
		custom-class="head"
		left-text=""
		@click-left="back"
		:left-arrow="props.leftArrow"
		fixed
		:bordered="false"
		:safeAreaInsetTop="true"
		:custom-style="props.customStyle"
	></wd-navbar>
</template>

<script setup>
const props = defineProps({
	title: {
		default: '7号助手',
		type: String,
	},
	leftArrow: {
		default: true,
		type: Boolean,
	},
	customStyle: {
		default: 'background-color:transparent;',
		type: String,
	},
})

const back = () => {
	let list = getCurrentPages()
	if (list.length == 1) {
		uni.switchTab({ url: '/pages/index/index' })
	} else {
		uni.navigateBack()
	}
}
</script>
<style scoped lang="scss">
:deep(.head) {
	width: 750rpx;
	background-color: transparent;
}
:deep(.wd-navbar__title) {
	color: #fff;
}
:deep(.wd-icon-arrow-left) {
	color: #fff;
}
</style>
